package com.djk.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.sql.SQLException;

@ControllerAdvice
@ResponseBody
@Slf4j
public class ResultException {
    @ExceptionHandler(value = Exception.class)
    public Result noramlException(Exception e) {
        log.error("内部发生异常...");
        e.printStackTrace();
        return Result.error("内部异常，请联系管理员！");
    }

}
